package com.ruoyi.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.domain.RawMatter;
import com.ruoyi.business.mapper.RawMatterMapper;
import com.ruoyi.business.service.RawMatterService;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author JerryLu
 * @date 2024/8/4 16:55
 * @description 原材料类别Service业务层处理
 */
@Service
public class RawMatterServiceImpl extends ServiceImpl<RawMatterMapper, RawMatter> implements RawMatterService {
    @Override
    public List<RawMatter> queryList(RawMatter rawMatter) {
        QueryWrapper<RawMatter> queryWrapper = Wrappers.query();
        if (StringUtils.isNotEmpty(rawMatter.getMateriaName())) {
            queryWrapper.like("materia_name", rawMatter.getMateriaName());
        }
        return this.list(queryWrapper);
    }
}
